// JS judgment browser UA
if(navigator.userAgent.match(/(iPhone|Android)/i)){
    console.log('移动端');
} else {
    console.log('PC端');
}

/*
The above code only judges the two most commonly used mobile phones, iPhone and Android.

In code "navigator.userAgent" It's the current UA.

*/